<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%><%@taglib
	uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Register to join with me</title>
	<meta  charset="UTF-8" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<!--[if IE 6]>
		<link href="css/ie6.css" rel="stylesheet" type="text/css" />
	<![endif]-->
	<!--[if IE 7]>
        <link href="css/ie7.css" rel="stylesheet" type="text/css" />  
	<![endif]-->
	
</head>

<body>
	  <div id="background">
			  <div id="page">
			
					 <div class="header">
						<div class="footer">
							<div class="body">
							  
							  	<!-- include Menu -->
									<jsp:include page="Menu.jsp" flush="True">
										<jsp:param name="page_call"  value="AdminPage"/>
									</jsp:include>
									
									<div id="content" >
									
									    <img src="images/cotton-flower.jpg" width="726" height="546" alt="" title="">
										<div class="pagetitlebar">
											
											</div>
										<div class="pagecontent">
											<form name="formAddBook"method="post" action="AddBookServlet.do">							
												<table>												
													<tr>
														<td colspan="2"><b>รายละเอียดหนังสือ</b></td>
													</tr>
													<tr>
														<td align="right" valign="top" nowrap>ประเภทหนังสือ :</td>
														<td>
															<select name = "bookType">
																<sql:setDataSource dataSource="jdbc/sharewithme" var="sharewithme" />
																<c:catch var="ex">
																	<sql:query var="bookTypes" dataSource="${sharewithme}">
																		select BTypeID,BTypeName from TBBookType
																	</sql:query>
																</c:catch>
																<c:forEach items="${bookTypes.rows}" var="item">
																																		
																	<c:if test="${item.BTypeID == param.bookType}">
																		<option selected="selected" value="${item.BTypeID}">${item.BTypeName}</option>
																	</c:if>
																	<c:if test="${item.BTypeID != param.bookType}">
																		<option value="${item.BTypeID}">${item.BTypeName}</option>
																	</c:if>
																</c:forEach>
																
															</select>*
														</td>
													</tr>
													<tr>
														<td align="right">ISBN:</td>
														<td><input type="text" name="isbn"><input type="hidden" name="oldISBN" value="">*</td>
													</tr>
													<tr>
														<td align="right">ชื่อหนังสือภาษาไทย:</td>
														<td><input type="text" name="bookNameTH" size="60" maxlength="255">*</td>
													</tr>
													<tr>
														<td align="right">ชื่อหนังสือภาษาอังกฤษ:</td>
														<td><input type="text" name="bookNameEN" size="60" maxlength="255"></td>
													</tr>
													<tr>
														<td align="right">ชื่อผู้เขียน:</td>
														<td><input type="text" name="author" size="30" maxlength="255"></td>
													</tr>
													<tr>
														<td align="right">สำนักพิมพ์:</td>
														<td><input type="text" name="publisher"  size="30" maxlength="255"></td>
													</tr>
													<tr>
														<td align="right">พิมพ์ครั้งที่:</td>
														<td><input type="text" name="publishNo" size="2" maxlength="3"></td>
													</tr>
													<tr>
														<td align="right">ชื่อผู้แปล:</td>
														<td><input type="text" name="translator" size="30" maxlength="255"></td>
													</tr>
													<tr>
														<td align="right">ราคา:</td>
														<td><input type="text" name="price" size="5"></td>
													</tr>
													<tr>
														<td align="right">จำนวนหน้า:</td>
														<td><input type="text" name="totalPage" size="5"></td>
													</tr>												
													<tr>
														<td align="right"></td>
														<td>
															<input type="button" name="buttonSave" value="Save" onclick="formAddBook.submit()">
															<input type="button" name="buttonCancel" value="Cancel" onclick="frmBack.submit()">
														</td>
													</tr>
												</table>
											
										</form>
												
										<form name="frmBack" method="post" action="AdminBookList.jsp">
											<input name="bookType" type="hidden" value="${param.bookType}">
										</form>

							</div>
									
									</div>
									
									
						</div>
					 </div>
					 <div class="shadow">&nbsp;</div>
			  </div>    
	  </div>    
	</div>
</body>
</html>